package szoftlab4sunak;


import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

public class VCell {
	
	private Cell ownCell; 			//Hozza tartozo Cell;
	private int width;				//Cella szelessege
	private int height;				//Cella magassaga

	//Konstruktor
	public VCell(Cell c){
		this.width = 100;
		this.height = 100;
		this.ownCell = c;

	}
	
	//Cella beallitasa
	public void setCell(Cell c){
		this.ownCell = c;
	}
	
	//Kirajzolas
	public void drawCell (Graphics g){
		
		
		if(ownCell.isRoad()==true)
			g.setColor(Color.gray);
		else
			g.setColor(Color.green);
		
		
		int posX = this.ownCell.getPosX();			//Pozicio lekerdezese a tarolt cellatol
		int posY = this.ownCell.getPosY();			//Pozicio lekerdezese a tarolt cellatol
		
		
		g.fillRect(posX, posY, this.width, this.height);		//Cella kirajzolasa
		g.setColor(new Color(0x29BA44));
		g.drawRect(posX, posY, this.width, this.height);		//Cella hatarainak kirajzolasa
		
		//Start kiirasa az elso cellaba
		if(ownCell.getID()==1){
		int fontSize = 25;
	    g.setFont(new Font("TimesRoman", Font.PLAIN, fontSize));     
	    g.setColor(Color.black);	    
	    g.drawString("Start", 20,20);
		}
		
		//End kiirasa az cel cellaba
		if(ownCell.getID()==36){
			int fontSize = 25;
		    g.setFont(new Font("TimesRoman", Font.PLAIN, fontSize));     
		    g.setColor(Color.black);	    
		    g.drawString("End", 530, 520);
		}
		
	}
}
